package com.minimalist.basic.entity.po.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class MConfigTableDef extends TableDef {

    /**
     * 参数配置表 实体类。

 @author 小太阳
 @since 2024-10-18
     */
    public static final MConfigTableDef MCONFIG = new MConfigTableDef();

    /**
     * ID自增
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 状态  0禁用 1正常
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 逻辑删除
     */
    public final QueryColumn DELETED = new QueryColumn(this, "deleted");

    /**
     * 版本号
     */
    public final QueryColumn VERSION = new QueryColumn(this, "version");

    /**
     * 参数ID
     */
    public final QueryColumn CONFIG_ID = new QueryColumn(this, "config_id");

    /**
     * 创建人ID
     */
    public final QueryColumn CREATE_ID = new QueryColumn(this, "create_id");

    /**
     * 更新人ID
     */
    public final QueryColumn UPDATE_ID = new QueryColumn(this, "update_id");

    /**
     * 参数键名
     */
    public final QueryColumn CONFIG_KEY = new QueryColumn(this, "config_key");

    /**
     * 参数名称
     */
    public final QueryColumn CONFIG_NAME = new QueryColumn(this, "config_name");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 更新时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 参数键值
     */
    public final QueryColumn CONFIG_VALUE = new QueryColumn(this, "config_value");

    /**
     * 说明
     */
    public final QueryColumn DESCRIPTION = new QueryColumn(this, "description");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, STATUS, VERSION, CONFIG_ID, CREATE_ID, UPDATE_ID, CONFIG_KEY, CONFIG_NAME, CREATE_TIME, UPDATE_TIME, CONFIG_VALUE, DESCRIPTION};

    public MConfigTableDef() {
        super("", "m_config");
    }

    private MConfigTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    @Override
    public MConfigTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new MConfigTableDef("", "m_config", alias));
    }

}
